#include <iostream>
#include <string>
using namespace std;

int main()
{
    string num1,num2;
    while (cin >> num1 >> num2){
        int sum = 0;
        for (size_t i=0; i<num1.size(); i++)
            for (size_t j=0; j<num2.size(); j++)
                sum += (num1[i]-'0')*(num2[j]-'0');
        cout << sum << endl;
    }
}
